package com.wang.springcloud.service;

import com.wang.springcloud.entities.Dept;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;


/**
 *
 * @Description: 修改microservicecloud-api工程，根据已经有的DeptClientService接口

新建

一个实现了FallbackFactory接口的类DeptClientServiceFallbackFactory
 * @author zzyy
 * @date 2018年4月21日
 */
@FeignClient(value = "MICROSERVICECLOUD-DEPT", fallbackFactory = DeptClientServiceFallbackFactory.class)
public interface DeptClientService {
	/**
	 * 根据 部门id 获取部门信息
	 *
	 * @param id
	 * @return
	 */
	@GetMapping(value = "/dept/get/{id}")
	public Dept get(@PathVariable("id") long id);

	/**
	 * 获取 部门列表
	 *
	 * @return
	 */
	@GetMapping(value = "/dept/list")
	public List<Dept> list();

	/**
	 * 新增 部门
	 * @param dept
	 * @return
	 */
	@PostMapping(value = "/dept/add")
	public boolean add(Dept dept);
}
